﻿<div ng-controller="adminHomeController" ng-init="challenge()">
    <style>
        .set {
            margin-top: 50px;
        }
        th {
            text-align: center;
        }
        td {
            text-align: center;
        }
        /*body {
            background: #d6e2ea;
        }*/
    </style>
    <div class="row" style="padding-bottom: 20px">
        <img src="http://txsaywhat.com/uploads/misc/DSHS_Logo_2.png" height="100" /><img src="http://upload.wikimedia.org/wikipedia/commons/f/f2/Dallas,_Texas_Skyline_2006.jpg" height="125" width="885" /><br />
    </div>
    <br />
    <fieldset>
        <legend><span style="font-size:x-large; color: #c30000;">Active Vehicle List</span></legend>
    </fieldset>
    <table class="table table-responsive table-bordered table-striped">
        <thead>
            <tr>
                <th><h4>License plate</h4></th>
                <th><h4>Make</h4></th>
                <th><h4>Model</h4></th>
                <th><h4>Year</h4></th>
                <th><h4>Get details</h4></th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="vm in vehicles.vehicleAdminInfoCascade">
                <td ng-bind="vm.licPlate"><h5></h5></td>
                <td ng-bind="vm.make"><h5></h5></td>
                <td ng-bind="vm.model"><h5></h5></td>
                <td ng-bind="vm.year"><h5></h5></td>
                <td>
                    <input type="button" ng-click="getVehicle(vm.vehicleId)" class="btn btn-info" value="Details" />
                </td>
            </tr>
        </tbody>
    </table>
    <fieldset>
        <legend><span style="font-size:x-large; color: #c30000;">Reserved Vehicle List</span></legend>
    </fieldset>
    <table class="table table-responsive table-bordered table-striped">
        <thead>
            <tr>
                <th><h4>License plate</h4></th>
                <th><h4>Make</h4></th>
                <th><h4>Model</h4></th>
                <th><h4>Year</h4></th>
                <th><h4>Reservation dates</h4></th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="vm in vehicles.vehicleAdminInfoReservedCascade" id={{vm.vehicleId}}>
                <td ng-bind="vm.licPlate"></td>
                <td ng-bind="vm.make"></td>
                <td ng-bind="vm.model">></td>
                <td ng-bind="vm.year"></td>
                <td>
                    <table id={{vm.licPlate}} class="table table-striped">
                        <tbody id="tbodyReservations">
                            <tr ng-cloak ng-repeat="date in vm.reservationsDates | orderBy:'dateStart'">
                                <td>{{ date.dateStart | date : mm/dd/yyy}} - {{date.dateEnd | date : mm/dd/yyy}}</td>
                                <td>
                                    <input ng-click="cancel(date, $index)" value="Cancel" type="button" class="btn btn-danger" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
</div>
